import request from "@/utils/request";
import { AxiosPromise } from "axios";
import { ICardData, ILineData, IPillarData } from "./types";

/* CardData */
export function getCardDataAPI(): AxiosPromise<ICardData> {
  return request({
    url: `/api/echarts/sum`,
    method: "get",
  });
}

/* 饼状图，社团人数比例 */
export function getPieDataAPI(): AxiosPromise<any[]> {
  return request({
    url: `/api/echarts/pie`,
    method: "get",
  });
}

/* 柱状图，学生会人数比例 */
export function getPillarDataAPI(): AxiosPromise<IPillarData> {
  return request({
    url: `/api/echarts/pillar`,
    method: "get",
  });
}

/* 折现图，近七天活动数量*/
export function getLineDataAPI(): AxiosPromise<ILineData> {
  return request({
    url: `/api/echarts/line`,
    method: "get",
  });
}
